import { defineConfig, presetIcons, transformerDirectives, presetWind3 } from 'unocss'
import { FileSystemIconLoader } from '@iconify/utils/lib/loader/node-loaders'
export default defineConfig({
  content: {
    pipeline: {
      include: [
        // the default
        /\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/,
        // include js/ts files
        'src/**/*.{js,ts}'
      ]
      // exclude files
      // exclude: []
    }
  },
  presets: [
    presetWind3(),
    presetIcons({
      warn: true,
      prefix: ['i-'],
      unit: 'em',
      collections: {
        // iconify的图标
        // 属性名对应icons下的文件夹名称
        // common: FileSystemIconLoader('src/renderer/src/assets/icons/common'),
      }
    })
  ],
  rules: [
    [
      /^text-overflow-(\d+)$/,
      ([_, d]) =>
        d === '1'
          ? { 'white-space': 'nowrap', overflow: 'hidden', 'text-overflow': 'ellipsis' }
          : {
              display: '-webkit-box',
              '-webkit-line-clamp': d,
              'line-clamp': d,
              '-webkit-box-orient': 'vertical',
              'box-orient': 'vertical',
              overflow: 'hidden',
              'text-overflow': 'ellipsis'
            }
    ]
  ],
  safelist: [
    // ...Object.keys(eleIcons.icons).map((v) => `i-ele-${v}`),
   
  ],
  transformers: [transformerDirectives()]
})
